local joy__zuzhou = fk.CreateSkill {

  name = "joy__zuzhou",

  tags = {  },

}



joy__zuzhou:addEffect(fk.TurnStart, {
  name = "joy__zuzhou",
  events = {fk.TurnStart},
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(joy__zuzhou.name) and not target.dead and target.hp > 0
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askForSkillInvoke(player, joy__zuzhou.name, nil, "#joy__zuzhou-invoke:"..target.id)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:loseHp(player, 1, joy__zuzhou.name)
    local choice = room:askForChoice(player, {"joy__zuzhou_slash2jink","joy__zuzhou_jink2slash"}, joy__zuzhou.name)
    room:setPlayerMark(target, "@joy__zuzhou-turn", choice)
    target:filterHandcards()
  end,
})

joy__zuzhou:addEffect("filter", {
  name = "#joy__zuzhou_filter",
  card_filter = function(self,  card, player)
    local mark = player:getMark("@joy__zuzhou-turn")
    if mark ~= 0 then
      if mark == "joy__zuzhou_slash2jink" then
        return table.contains(player.player_cards[Player.Hand], card.id) and card.trueName == "slash"
      else
        return table.contains(player.player_cards[Player.Hand], card.id) and card.trueName == "jink"
      end
    end
  end,
  view_as = function(self, player,card)
    if card.trueName == "slash" then
      return Fk:cloneCard("jink", card.suit, card.number)
    else
      return Fk:cloneCard("slash", card.suit, card.number)
    end
  end,
})

return joy__zuzhou